From: Marco Trevisan (TreviƱo) Date: Thu, 10 Sep 2026 16:45:22 +0000 (+0200) Subject: notificationDaemon: Use static values for the serialized name and format X-Git-Tag: archive/raspbian/50.5-1+rpi1^2~6^2^2~7 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b6ff90d147bf7e56c03bfadadb24f606266e20d1;p=gnome-shell.git notificationDaemon: Use static values for the serialized name and format Avoid repeating these multiple times Part-of: (cherry picked from commit 01ec33e864c2e9b29c79f7293e3b8a59a71b4350) --- diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index e94a9e81d..9ea539c56 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -14,6 +14,9 @@ import {NotificationErrors, NotificationError} from '../misc/dbusErrors.js'; const FdoNotificationsIface = loadInterfaceXML('org.freedesktop.Notifications'); +const NOTIFICATION_SERIALIZED_NAME = 'notifications'; +const NOTIFICATION_SERIALIZED_FORMAT = 'a(sa(sv))'; + /** @enum {number} */ const NotificationClosedReason = { EXPIRED: 1, @@ -615,7 +618,10 @@ class GtkNotificationDaemon { this._isLoading = true; try { - const value = global.get_persistent_state('a(sa(sv))', 'notifications'); + const value = global.get_persistent_state( + NOTIFICATION_SERIALIZED_FORMAT, + NOTIFICATION_SERIALIZED_NAME); + if (value) { const sources = value.deepUnpack(); sources.forEach(([appId, notifications]) => { @@ -658,7 +664,8 @@ class GtkNotificationDaemon { sources.push(source.serialize()); } - global.set_persistent_state('notifications', new GLib.Variant('a(sa(sv))', sources)); + global.set_persistent_state(NOTIFICATION_SERIALIZED_NAME, + new GLib.Variant(NOTIFICATION_SERIALIZED_FORMAT, sources)); } AddNotificationAsync(params, invocation) {